package com.zxn.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zxn.project.pojo.User;
import com.zxn.project.pojo.UserGroupRel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserGroupMapper extends BaseMapper<UserGroupRel> {


    @Select("SELECT user_id  FROM user_group_rel where group_id=#{id}")
    @Result(property = "user",column = "user_id",
            one = @One(select = "com.zxn.project.mapper.UserMapper.selectById"))
    List<User> selectUserByGroupID(Long id);
}
